package com.yzkj.cpjxc.business.service;

import com.yzkj.cpjxc.business.framework.common.BusinessMap;
import com.yzkj.cpjxc.business.framework.common.Pager;
import com.yzkj.cpjxc.business.domain.ZTreeComm;
import com.yzkj.cpjxc.business.domain.SysAuthority;
import com.yzkj.cpjxc.business.domain.SysAuthorityQueryVo;
import com.yzkj.cpjxc.business.domain.SysAuthorityShowVo;

import java.util.List;

/**权限事务管理接口
 */
public interface SysAuthorityService {
	
	/**
	 * 根据条件查询权限
	 */
	public List<SysAuthority> queryByCondition(SysAuthorityQueryVo queryVo) throws Exception;

	/**
	 * 获取查询分页对象
	 */
	public Pager<SysAuthorityShowVo> search(Pager<SysAuthorityShowVo> pager, SysAuthority sa) throws Exception;

	/**
	 * 新增权限
	 */
	public BusinessMap create(SysAuthority sa) throws Exception;

	/**
	 * 判断是否存在
	 */
	public boolean isExists(SysAuthority sa) throws Exception;

	/**
	 * 根据ID获取部门
	 */
	public SysAuthority getById(String sysAuthorityId) throws Exception;

	/**
	 * 编辑权限
	 */
	public BusinessMap edit(SysAuthority sa) throws Exception;

	/**
	 * 根据ID删除权限（逻辑删除，不做物理删除）
	 */
	public boolean delete(String sysAuthorityId) throws Exception;

	/**
	 * 根据levelCode（层级代码）进行删除，包括它的下级权限
	 */
	public boolean deleteByLevelCode(String levelCode) throws Exception;

	
	/**
	 * 根据系统用户Id用户查询拥有的所有权限集合
	 */
	public List<SysAuthority> getSysAuthoritysByUserId(String sysUserId) throws Exception;


	/**
	 * 是否存在系统
	 */
	public boolean isExistsSystem(SysAuthority sysAuthority) throws Exception;
	
	/**
	 * 根据levelCode获得所有子节点
	 */
	public List<ZTreeComm> getAllChildByLevelCode(String levelCode) throws Exception;
	
	
	/**
	 * 初始化权限数据
	 */
	public void initData() throws Exception;

	public List<SysAuthority> getSysAuthoritysByRoleId(String sysRoleId) throws Exception;
	
	/**
	 * @description: 获取顶级权限(代表业务系统)
	 */
	public SysAuthority getTopLevelSysAuthority() throws Exception;

	public BusinessMap editChildStatusByLevelCode(SysAuthority sau) throws Exception;

	public BusinessMap editChildStatusId(List<String> listIds) throws Exception;

	public boolean isHavaChilds(String levelCode) throws Exception;
	
}
